Rick Strahl's Weblog  

Wind, waves, code and everything in between...
.NET • C# • Markdown • WPF • All Things Web
Contact   •   Articles   •   Products   •   Support   •   Advertise
Sponsored by:
Markdown Monster - The Markdown Editor for Windows

WebLog Posts in Category Visual Studio


Categories
ASP.NET (325) .NET (182) Windows (78) JavaScript (72) jQuery (61) Visual Studio (54) WPF (48) IIS (48) Csharp (47) HTML (46) AJAX (45) ASP.NET (33) Localization (32) LINQ (30) WCF (28) MVC (26) Personal (25) Security (23) HTML5 (23) FoxPro (22) CSS (21) C# (20) Angular (20) Web Services (19) Web Api (16) COM (16) ADO.NET (15) Vista (11) Sql Server (11) XML (11) WebView (10) HTTP (10) IIS7 (10) Markdown (9) Microsoft AJAX (8) IIS7 (7) West Wind Ajax Toolkit (7) Web Connection (7) NuGet (6) Markdown Monster (6) Entity Framework (6) Html Help Builder (5) Live Writer (5) Internet Explorer (5) C++ (5) ASPNET5 (5) Mobile (5) SignalR (5) Software Development (5) Web (5) OWIN (5) WinForms (5) Westwind.Globalization (4) Source Control (4) Silverlight (4) Cordova (4) Conferences (3) DataBinding (3) ASP.NET Core (3) Help Builder (3) ISV (3) LetsEncrypt (3) Networking (3) Office (3) Opinion (3) Razor (3) Web Browser Control (3) WebLog (3) Web Development (2) Visual Studio Code (2) Tools (2) Speaking (2) RegEx (2) RSS (2) Linux (2) Installation (2) Bugs (2) Help (2) Dotnet (2) .NET Standard (2) Addins (2) Deployment (2) Authentication (2) ASP.NET vNext (2) ADO.NET (1) Chocolatey (1) Blazor (1) Blogging (1) Desktop (1) Control Development (1) Credit Card Processing (1) Cross-Platform (1) .NET ASP.NET Windows (1) Security (1) Visual Studio (1) ASP.NET IIS (1) ASP.NET Markdown (1) AI (1) Angular JavaScript (1) Dynamic Types (1) Email (1) CSharp Dotnet (1) Git (1) Graphics (1) Hardware (1) FireFox (1) Flexbox (1) IOS (1) JSON (1) Migration (1) rxJs (1) SEO (1) RazorPages (1) Musings (1) Travel (1) Typescript (1) Testing (1) Threading (1) VS Code (1) Web Deployment Projects (1) Web Design (1) Web Assembly (1) WebSockets (1) WebSurge (1) WebBrowser (1) WebDeploy (1) WFH (1) Windows-Terminal (1) Windsurfing (1) WPF Windows (1) WSL (1) wwHoverPanel (1)

Creating a Static Web Content Project for Publishing with WebDeploy



Static content projects are more and more common and if you need to publish directly to an IIS Web Server using WebDeploy is one of the options you have. If you're building .NET projects there are many ways to publish projects from Visual Studio and the `dotnet` CLI. Unfortunately there currently is no .NET/Visual Studio project type that works out of the box for Static Site content - if you need to use WebDeploy. In this post I discuss how to hack a .NET Web project to work with static content only.

Back to Basics: Add an ASP.NET Runtime Information Startup Banner



In almost every .NET Core Console application I end up adding a startup banner with some basic runtime information so I can see at a glance what environment I'm running in. I also add the URLs and any other application specific information that might be useful. In this short post I show a few things I display and how I reuse this functionality since it practically goes into every application I run.

Excluding Files and Folders in Visual Studio Web Site Project



I still use Web Site projects frequently for purely static Web sites that don't require a proper build process where 'DevOps' of any kind is overkill. Invariably when using Web site projects though, I end up requiring that 1 or 2 files are excluded on publishing and every time I do I spent a while trying to find the information how to do that in the `.pubxml` file. Well no more - I'm writing it down this time.

VSIX Installer Extension Manifest and Visual Studio Version Numbers



Ran into a problem with updating a Visual Studio extension today where the VSIX installer first failed to install for the latest version of Visual Studio and then failed to enable the option to install for that same version. Turns out it was related to incorrectly specifying the right version number for VS 2019 and in this post I show how to use the correct (and somewhat unexpected) version syntax.

Visual Studio 2019.2 and .NET 3.0 SDK Projects not Loading



Recent upgrades to Visual Studio 2019.2 seem to have broken projects that use the 3.0 .NET SDK as Visual Studio is defaulting to a pre-3.0 version of the SDK tools and compilers. The end result is that projects even fail to load in Visual Studio. There are workarounds but ultimately this an issue that Microsoft needs to address better in future updates.

A Visual Studio to Visual Studio Code Snippet Converter



Visual Studio Code Snippets are very useful and a great productivity enhancing tool for templating reusable code blocks into the editor. I have tons of snippets I use all the time for great productivity savings. Over the last couple of years I've been increasingly using Visual Studio Code and JetBrains Rider and I found myself missing my nearly 150 code snippets from Visual Studio, so I created a small hacky utility to move code snippets from Visual Studio to VS Code and with more limited features to Rider.

Tip: Open Visual Studio Code from Visual Studio as an External Tool



I use both Visual Studio and Visual Studio Code in my development. Although I tend to still default to the full version of Visual Studio, I tend to run Visual Studio Code side by side with Visual Studio and flip back and forth a lot. To make things a little easier and being able to jump directly to a document in VS Code from full VS you can create an External Tool entry and a shortcut mapping to quickly open documents and/or folders in VS Code.

Fixing Visual Studio Intellisense Errors



I ran into a problem in one of my applications where Visual Studio was showing errors that were clearly not actual errors. A new feature in Visual Studio now shows separate error listings for Build and IntelliSense errors and it turns out the errors are Intellisense errors. Here's how to fix them and get Visual Studio back onto the straight and narrow.

JavaScript Debugging in a Web Browser Control with Visual Studio



Debugging a Web Browser Control embedded in a Windows application can be a bear because there's no obvious way to debug the the JavaScript code or HTML DOM/CSS inside of the application. Although the Web Browser uses the Internet Explorer Engine for HTML rendering and JavaScript execution and provides most of the engine features, the Debugger and F12 are not part of that. As it turns out you can use Visual Studio to hook up a script debugger and provide a rich debugging experience with the full IE debugger, Console and even a DOM/CSS Explorer. In this post I show how.

Adding Files to Visual Studio Projects



Visual Studio has a boat load of ways to add new files to a project and various extensions and tools provide even more ways to do the same. Even so the experience to add new files to a project in Visual Studio is one of the most tedious tasks. Here's what bugs me and how I try to work around the verbosity of it all.

Visual Studio Debugging and 64 Bit .NET Applications



Recently while debugging a 64 bit application I found out the hard way that Visual Studio by default will use 32 bit debugging even when running what would otherwise be a 64 bit .NET application. There are a number of options that determine the bitness of your application, but the debugger often behaves differently than your standalone application. In this post I describe, why this might be a problem in some situations and how you can get the debugger to run in 64 bit.

Excluding the node_modules Folder in Visual Studio WebSite Projects



If you're working on a client side project that includes an NPM folder with a large number of dependencies and you're using a WebSite Project in Visual Studio, you've probably found that this is a terrible combination out of the box. In this post I describe why this is a problem and how you can work around it with a simple hack.

Upgrading to ASP.NET Core RTM from RC2



I installed and upgraded an ASP.NET Core Sample application today and while the actual project upgrade process from RC2 was relatively easy, there were a few hiccups with installation and one of the breaking changes for the RTM release. In this post I'll go over some of the things I ran into and the workarounds.

Registering and Unregistering a VSIX Extension from the Command Line



If you use VSIX extensions and you need to install them as part of an installation script, you can use the VSIX Installer executable that ships with Visual Studio to control the install and uninstall process.

Cordova and Visual Studio CODE Magazine Article



Looks like my "Taming Mobile Apps with Cordova and Visual Studio" article went live recently. If you want to find out how to use the new and pretty awesome Visual Studio Tools for Apache Cordova for building Web based, hybrid Mobile apps, this article is a great starting point. The article gives an overview of Cordova and then walks through examples with special focus on building iOS apps.

Tip: Create a Visual Studio Menu option to Open a Terminal (and other things)



I'm finding myself using the command line more and more, especially with ASP.NET vNext for running Web apps from the command line, accessing git and JavaScript build tools. Here's a real easy way to pop open a Command Window in the active project directory from Visual Studio.

Using Cordova and Visual Studio to build iOS Mobile Apps



Apache Cordova is a hybrid mobile toolset to build Mobile applications using Web Technologies like HTML5, CSS and JavaScript. Microsoft recently released a preview of its toolset for building Cordova applications with Visual Studio. In this article Rick takes a look at the Visual Studio Tools for Apache Cordova for building, debugging and running iOS mobile applications from Windows by way of an example that takes an existing mobile Web AlbumViewer app and porting it to Cordova.

Visual Studio 2013 'Could not evaluate Expression' Debugger Abnormality



Ran into an oddball debugger issue last week with an older project in Visual Studio 2013 where all breakpoints show 'Could not evaluate expression' instead of displaying values. This post shows the problem and a couple of ways around it.

Publish Individual Files to your Server in Visual Studio 2012.2



Visual Studio 2012 Update 2 introduces a little known new Web Publish feature that allows publishing individual files to the server. While not a high frequency usage case, it's handy for content files or when you just published a large project and realized you forgot to include a file in the project to publish.

Text Editor Associations/Extensions in Visual Studio getting lost



Visual Studio allows you to create text editor extensions that map standard Visual Studio editors to custom extensions. It's a useful feature that I use a lot with some older products, but unfortunately I've seen alot of cases where the editor/extension mapping gets lost even though Visual Studio still shows it as registered. Here's more info on the problem and how to fix it at least temporarily.

No JavaScript IntelliSense in VS 2010 Beta 2? Reset your Settings



When I installed Visual Studio 2010 a couple of days ago I was really disappointed to see that Intellisense failed to work completely in the new install. No workey in .js files, or ASPX pages inside of script blocks. After some back and forth with folks on the ASPInsiders list and the product teams it looks like there is an issue somewhere with the default settings that get set when Visual Studio...

Debugger Visualizers not working in ASP.NET Medium Trust



Debugger visualizers are quite useful for looking at common content while in the middle of debugging your application. However I've run into a number of problems with the debugger visualizer not popping up in ASP.NET applications due to the security environment. Turns out you need full trust in order to use debugger visualizers in ASP.NET applications.

Creating Visual Studio Templates from your Web Projects



Visual Studio has the nice capability to create project templates from existing projects and with a little bit of work it's real easy to create a project environment that's ready to roll without having to dig for related components first. This applies to Web projects more than anything for me as I have a fair bit of generic utility code that is project specific and needs to be added to just about all projects. Templates make this real quick and easy. Here's how.

I can’t find my Find Dialog in Visual Studio



Ironic ain’t it? I can’t find my Find Dialog in Visual Studio and I can’t use find to find it. Ok funny, but at the time it didn’t seem too funny because I needed to really find something in a rather large JavaScript source file. But when pressing Ctrl-F (or Ctrl-H for Find/Replace) in Visual Studio rather than getting the familiar Find Dialog I got a slight flicker and a whole lotta nothing...

Web Application Project generated CodeBehind .designer file not being updated



I've been running into problems with WAP page CodeBehind files (.designer.cs) files not being updated from time to time. Here's how this can happen and a few ways to fix the problem and get on with life.

"Variable is assigned but its Value is never used" Warning



It’s late, but here’s a little humor for ‘ya. I’ve been noticing recently that I’ve been getting some odd warnings in Visual Studio for variables that are defined and never used. Check out the following screen shot from C# code editor: Notice how the compiler is warning about isSelected not being used, but as you can see just a few lines down it is in fact being used in an assignment. At first I...

HTML Mangling with Literal Controls in the <head> tag



Ran into an odd problem with Literal controls in the head tag of the document causing HTML to get corrupted today. It appears that literal controls - and only literal controls - are causing some odd designer manglage that can result in broken HTML.

LINQ to SQL DBML fails to build or open



Arrgh. Today I got back to a LINQ to SQL app that’s been sitting idle for some time. It’s a demo app and as I started the app up and compiled the solution I got: Error 1 Build failed due to validation errors in C:\projects2008\TimeTrakker\TimeTrakkerBusiness\model\TimeTrakker.dbml. Open the file and resolve the issues in the Error List, then try rebuilding the project....

ASP.NET Designer Control Problem in VS 2008 SP1



I've been running into problems with VS 2008 SP1 where controls appear to be failing frequently with property assignment errors that seem completely unwarranted. Controls work fine on a page, and next thing I know they fail for no apparent reason.

Lost (and found) Visual Studio Templates in Web Project



So I just lost all of my project templates in Web projects. I've been working on a small utility page on my site that generates help documentation on the fly. I've been working happily along on this site when all of a sudden when I needed to add a config file to control debugging and authentication on this page/app. could not find a part of the path 'C:\programs\vs2008\ Common...

Grayed out ASP.NET Toolbox Controls? Check your Mouse!



Have you run into a problem with the ASP.NET where you can't access toolbox items for add-on controls? You're not the only one. Apparently there's a bug that causes some hardware configurations involving Microsoft Laser mice to cause problems with the idle state that the designer uses to refresh controls and certain designer aspects.

Visual Studio Hotfix for Slow Web Forms Editing and Input Focus Issues



Microsoft has just released a hotfix for a number of issues that have been plaguing me for some time in Visual Studio 2008. The issues involved have to do with the visual designer and the HTML code editor and a number of different input focus and slow input situations. You can get the hotfix from here:...

Issue: Migrating Web Application Projects between VS 2005 and VS 2008



If you move Web Application Projects between Visual Studio 2008 and Visual Studio 2005 and a machine that doesn't have Visual Studio 2005 installed you will find that the project doesn't load due to a build target difference.

Ctrl-S in web.config in Visual Studio closes web.config file



If you've hit a bug in Visual Studio where you hit Ctrl-S/Save while editing a web.config file causes the web.config file to close, you're not alone. Looks like the ADO.NET Entity Tools Designer somehow mucked up the Visual Studio save option for web.config files.

Visual Studio and <location> parsing in web.config



So here's a funky Visual Studio behavior: On my root Web site (which is mostly static) I have my web.config set up to handle the root site configuration in a separate <location> element in order not to force the settings of the root site down into the many, many virtual...

Rendering a WPF Container to Bitmap



One of WPF's nicer features is its ability to render any visual into a bitmap easily, and so I thought I'd create a simple little tool that would create rounded corner bitmap bars with transparent backgrounds. It's actually quite easy to do, but I ran into a few pitfalls and inconsistencies that make WPF coding oh so much fun.

LINQ to SQL and Serialization



LINQ to SQL provides entity objects that can be used easily for object access to data members. But these objects can be difficult to deal with if you need to serialize them in Web Services or in other ways because relationships are often circular. Here's a discussion of things to watch out for and how you can get around the issues.

Using Html Help Builder in Visual Studio 2008



Couple of people asked me over the last few days whether the Help Builder Visual Studio integration works with Orcas and the answer is yes. Automatic installation in Visual Studio 2008 will be provided with the next update shortly but there are a few small things that need to get addressed for this...

Version Fields and LINQ: Careful of underscores in Field Name



This probably falls into the bonehead category, but this might bite somebody else so I'm writing it up: LINQ to SQL works best when your database tables have version fields that can be used to see change state. So recluctantly I resigned myself to give in to this and decided I'd use a consistent...

Dynamic Expressions in Linq to Sql



Using LINQ there are two issues that I've been struggling with and both have to do with dynamic query results: Hitting the wall with SQL that can't be expressed via LINQ and using dynamic expressions inside of LINQ queries from within framework level code. As it turns out there are ways that this can be addressed with lower level LINQ methods that provide the abillty to be a bit more flexible in controlling what SQL gets executed and creating dynamic expressions for results.

Strong Name Validation failed when Debugging ASP.NET on IIS7



Ugh, since I installed a new machine I ran into this error message above earlier. That's a pretty omnious sounding error message which seems to hint at a mis-configuration during installation. The error occurs as soon as you try to debug a Web application against IIS 7... As it turns out the...

Open Folder in Windows Explorer in VS 2008



There's a silly little, but very useful addition on the project context menu in Visual Studio 2008 that lets you pop up Explorer in the project's folder easily. Sometimes it's a little thing that makes life a little easier.

Multiple Enumeration of LINQ results



LINQ result set enumeration can be a little unexpected if you don't pay close attention the returned Enumeration. Because of the way queries are enumerated at enumeration time, not when they are declared can easily result in multiple queries being run against the LINQ data or list source.

LINQ to SQL and Disconnected Entities Follow-up



Several people have been flogging me for my LINQ and disconnected Entity post, so I thought I should follow up on the issues I've been having. First let me restate Entity issue I raised a couple of days ago, but let me present it in a simpler context with the Northwind database, so you can try...

Web Application Project Conversion on Orcas



I'm going once again through a conversion from Stock Projects to a WAP project conversion this time for my Web Store. I've done the conversion once before but returned back to stock projects because of a Visual Web Developer requirement. Recently though development on the store has been a lot...

Moving Projects/Solutions between Orcas and Visual Studio 2005



With Orcas supporting multi-targeting it'll be common to work in Orcas with .NET 2.0 projects. But when you take a VS 2005 project/solution and open it in Orcas it wants to update to an Orcas solution and projects. Which is fine if you're working on your own thing, but if you share around projects...

Properties getting mixed up in VS 2005 ASP.NET Visual Designer



Here's an interesting problem in the ASP.NET designer in VS 2005: I have a custom control that has two properties with similar names. Somehow Visual Studio's designer appears to be getting the properties mixed up when trying to display the properties in the property sheet. Here are the property...

Watch out with precompiled ASP.NET 2.0 Applications if you have Orcas installed



Here's a stumper. Today I made a very minor change to my Web Store application. It's basically and administrative tweak to capture spam IP addresses and store them for later optional blocking. The change made didn't touch anything in the rest of the application. The Web Store is my last app that's...

A Setup Dialog you don't want to see



Here's what greeted me today after attempting to install Orcas Beta 1 on my machine:   <sigh> I was expecting this to happen. Most likely the issue here is that I had the preview release installed on this box as well and there are likely some left over items that are causing the...

Generics in CodeDom vs. Generics with Reflection



In Help Builder's documentation imports from .NET code I have to manage two sets of interfaces: One that imports data using Reflection which is the more thourough mechanism that goes out, parses types and pulls in XML documentation. Getting Generics to work right in that code took a while to get...

Using Project Template Export to create a generic WAP Template



I have a customer coming out tomorrow for a week long gig and as I was preparing for tomorrow's session I needed to set up new project. Starting up a new project and getting all the pieces into place for a Web application involves a fair amount of setup for me usually as I typically startup with a...

System.Argument Exceptions in W3wp.exe and the VS Just-in Time Debugger



I've been noticing that on my server quite frequently I get managed exceptions bubbling up to the Dr. Watson and/or the Visual Studio Just In Time Debugging dialog on the desktop. Now this being a server machine I'm not happy about this happening of course because it clutters the desktop the next...

FireFox and the Visual Studio Web Server = Snail’s pace?



Seems like Firefox and the internal Visual Studio Web Server don't work well together with FireFox running dog slow in this combination.

Web Application Projects and Visual Studio under Vista RC1



I’ve been working for the last couple of days with some code in Web Application Projects under Vista RC1 and I am having nothing but problems with the Visual Studio Web Designer...
West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2024